app.controller('BsShiftDetailCtrl', function ($scope, $stateParams, ajax) {

    $scope.shiftId = $stateParams.shiftId;

    $scope.reload = function () {
        ajax.call(new Req.GET({
            resource: 'shift/bs/' + $scope.shiftId + '/id'
        })).then(function (result) {
            if (result.code && result.code == 200) {
                $scope.shift = result.result.shift;
                $scope.driver = result.result.driver;
                $scope.vehicle = result.result.vehicle;
                $scope.stationList = result.result.station;
                ajax.call(new Req.GET({
                    resource: 'organization/' + $scope.shift.organizationId + '/id'
                })).then(function (result) {
                    if (result.code && result.code == 200)
                        $scope.organization = result.result;
                }, function () { });
            }
        }, function () { });
    };

    $scope.reload();
});